// 认证相关服务

// 存储JWT token到localStorage
export const setAuthToken = (token: string): void => {
  localStorage.setItem('authToken', token);
};

// 从localStorage获取JWT token
export const getAuthToken = (): string | null => {
  return localStorage.getItem('authToken');
};

// 清除localStorage中的JWT token
export const removeAuthToken = (): void => {
  localStorage.removeItem('authToken');
};

// 检查用户是否已登录
export const isAuthenticated = (): boolean => {
  return !!getAuthToken();
};